﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AppraiseListPage.aspx.cs" Inherits="Basic4Net.OAWeb.Module_Base.AppraiseListPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
        <link href="../App_Themes/ui-lightness/main.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../Scripts/jquery-1.4.1.js"></script>
    <script type="text/javascript" src="../Scripts/common.js"></script>
    <script type="text/javascript" src="../Scripts/Util.js"></script>
    
    <script language="javascript" type="text/javascript">
        function TypeAdd() {
            //document.getElementById("lbl_ToPage").innerHTML = 1;
            document.getElementById("hdf_SumID").value = "";
            var btn = document.getElementById("btnBind");
            btn.click();

        }

        function OpenDIV() {
            //            window.alert(document.getElementById("hdf_MaxPage").value);
            var hdf = document.getElementById("hdf_SumID");
            if (hdf.value != "") {
                ShowPopForm("popTable", "formTitle", "教工分类设置", "");
            }
            else {
                showMassgeBox("提示", "至少勾选一项!", 1);
            }
        }

        function cbxchange(TeacherID) {
            var hdf = document.getElementById("hdf_SumID");
            PageMethods.CheckBoxList(TeacherID, hdf.value, response);
        }

        function response(result) {
            document.getElementById("hdf_SumID").value = result;
        }

        function ChangeFType() {
            var ddl = document.getElementById("ddl_SetFType");
            var hdf = document.getElementById("hdf_SumID");
            //window.alert(document.getElementById("hdf_SumID").value)
            PageMethods.ChangeFType(hdf.value, ddl.value, reftype);

        }

        function reftype(succ) {
            if (!succ) {
                showMassgeBox("提示", "设置失败!", 1);
            }
            else {
                document.getElementById("btnBind").click();
                document.getElementById("hdf_SumID").value = "";
                ClosePopForm('popTable', true)
            }
        }

        function TopClick() {
            document.getElementById("txt_Go").value = 1;
            document.getElementById("btnBind").click();
            document.getElementById("lbl_ToPage").innerHTML = 1;
        }

        function UpClick() {
            var txt = document.getElementById("txt_Go");
            if (parseInt(txt.value) > 1) {
                txt.value = parseInt(txt.value) - 1;
                document.getElementById("btnBind").click();
                document.getElementById("lbl_ToPage").innerHTML = document.getElementById("txt_Go").value;
            }
        }

        function NextClick() {
            var txt = document.getElementById("txt_Go");
            if (parseInt(txt.value) < parseInt(document.getElementById("lbl_PageCount").innerHTML)) {
                txt.value = parseInt(txt.value) + 1;
                document.getElementById("btnBind").click();
                document.getElementById("lbl_ToPage").innerHTML = document.getElementById("txt_Go").value;
            }
        }

        function EndClick() {
            document.getElementById("txt_Go").value = document.getElementById("lbl_PageCount").innerHTML;
            document.getElementById("btnBind").click();
            document.getElementById("lbl_ToPage").innerHTML = document.getElementById("txt_Go").value;
        }

        function GoClick() {
            var txt = document.getElementById("txt_Go");
            if (parseInt(txt.value) >= parseInt(document.getElementById("lbl_PageCount").innerHTML)) {
                txt.value = document.getElementById("lbl_PageCount").innerHTML;
            }
            document.getElementById("btnBind").click();
            var patrn = /^[1-9]\d*$/;
            if (patrn.exec(txt.value)) {
                document.getElementById("lbl_ToPage").innerHTML = txt.value;
            }
        }


        //update by lxy 20100919 修改bug8 添加全选框功能
        function CheckAll(obj) {
            if (document.getElementById('settingTable') != null) {
                var table = document.getElementById('settingTable');
                var str = "";
                for (var i = 1; i < table.rows.length; i++) {
                    var row = table.rows[i];
                    var cell = row.cells[0];
                    if (cell.all.length > 0 && cell.all[0] != null) {
                        cell.all[0].checked = obj.checked;
                        var teacherId = cell.all[0].id;
                        str += teacherId + "|";
                    }
                }
                document.getElementById("hdf_SumID").value = str;
            }

        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:HiddenField ID="hdf_SumID" runat="server" Value="" />
        
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
        </asp:ScriptManager>
        <div class="mainWarp">
            <div class="pageBody">

            <table style="width: 100%;">
            <tr>
                <td colspan="6" style="height:10px">
                </td>
            </tr>
            <tr>
                
                <td style="text-align:left;width:240px">
                    分类：
                    <asp:DropDownList ID="ddl_FType" runat="server"></asp:DropDownList>
                </td>
                <td style="text-align:left;width:150px">
                    工号：<asp:TextBox ID="txt_TeacherCode" runat="server" Width="100px"></asp:TextBox>
                </td>
                <td style="text-align:left;width:150px">
                    姓名：<asp:TextBox ID="txt_TeacherName" runat="server" Width="100px"></asp:TextBox>
                </td>
                <td style="text-align:left;width:100px">
                    <input id="btn_Search" type="button" onclick="TypeAdd()" class="commonBut" 
                        value="搜索" />
                </td>
                <td style="text-align:left;width:50px"><input id="btn_Commit" type="button" value="批量设置分类" onclick="OpenDIV()" class="commonBut"/></td>
                <td ></td>
            </tr>
            <tr>
                <td colspan="6" style="height:10px">
                </td>
            </tr>
            <tr>
                <td colspan="6" align="left">

                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                               <asp:Repeater ID="rpt_TeacherType" runat="server" >
                                <HeaderTemplate>
                                <table id="settingTable" style="width:75%" class="useList1" border="0" cellpadding="0" cellspacing="1">
                                    <tr  class="tableTitle">
                                        <th><input id='chkAll' type="checkbox" onclick="CheckAll(this);" /></th>
                                        <th>
                                            评奖分类
                                        </th>
                                        <th>
                                            工号
                                        </th>
                                        <th>
                                            姓名
                                        </th>
                                        <th>
                                            性别
                                        </th>
<%--                                        <th>
                                            出生日期
                                        </th>--%>
                                    </tr>
                                </HeaderTemplate>
                            <ItemTemplate>
                            <tr >
                                <td>
                                    <input type="checkbox" <%# GetCbxState(DataBinder.Eval(Container.DataItem,"TeacherID").ToString()) %>  id='<%# DataBinder.Eval(Container.DataItem,"TeacherID") %>' onclick='cbxchange(<%# DataBinder.Eval(Container.DataItem,"TeacherID") %>)' />
                                </td>
                                <td style="text-align:left">
                                    <%# DataBinder.Eval(Container.DataItem, "AppraiseName")%>
                                </td>
                                <td style="text-align:left">
                                    <%# DataBinder.Eval(Container.DataItem, "TeachCode")%>
                                </td>
                                <td style="text-align:left">
                                    <%# DataBinder.Eval(Container.DataItem, "TeachName")%>
                                </td>
                                <td>
                                    <%# Basic4Net.Utility.Common.Common.GetSexy(DataBinder.Eval(Container.DataItem, "Sexy"))%>
                                </td>
<%--                                <td>
                                    <%# Basic4Net.Utility.Common.Common.GetShortDate(DataBinder.Eval(Container.DataItem, "Birthday"))%>
                                </td>--%>
                            </tr>
                            </ItemTemplate>
                            <FooterTemplate>
                                </table>
                            </FooterTemplate>
                            </asp:Repeater>
                    <div class="page" style="width:60%;margin-top:10px">
                    <span ><input id="lbnTop" type="button" value="首页" class="commonBut" onclick="TopClick()" /></span>
                    <span ><input id="lbnUp" type="button" value="上一页" class="commonBut" onclick="UpClick()" /></span>
                    <span ><input id="lbnNext" type="button" value="下一页" class="commonBut" onclick="NextClick()" /></span>
                    <span ><input id="lbnEnd" type="button" value="末页" class="commonBut" onclick="EndClick()" /></span>
                    <span class="disabled"><asp:Label ID="lbl_L_Di" runat="server" Text="第"></asp:Label> <asp:Label ID="lbl_ToPage" runat="server" Text="0"></asp:Label> / <asp:Label ID="lbl_PageCount" runat="server" Text="0"></asp:Label> <asp:Label ID="lbl_L_Yie" runat="server" Text="页"></asp:Label></span>
                    <span ><asp:Label ID="lbl_L_TD" runat="server" Text="跳到"></asp:Label><span class="shoppingnumber">
                                        <asp:TextBox ID="txt_Go" CssClass="logininput" Text="" runat="server" Width="50px"></asp:TextBox>
                                        <asp:regularexpressionvalidator id="REV_Go" runat="server" ErrorMessage="RegularExpressionValidator" Display="Dynamic"
					                        ControlToValidate="txt_Go" ValidationExpression="^[1-9]\d*$">*</asp:regularexpressionvalidator>
                                        </span><asp:Label ID="lbl_L_Yie2" runat="server" Text="页"></asp:Label></span>
                    <span ><input id="lbnGo" type="button" value="跳转" class="commonBut" onclick="GoClick()" /></span>
                    </div>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="btnBind"  EventName="Click" />
                    </Triggers>

                </asp:UpdatePanel>
    
                </td>
            </tr>
            <tr>
                <td colspan="6" style="height:50px"></td>
            </tr>
        </table>

            <div style="display: none;">
                <asp:Button ID="btnBind" runat="server" OnClick="btnBind_Click" Text="btnBind" />
            </div>

            <div id="popTable" class="layoutWarp" style="display: none; width: 280px;overflow: inherit; ">
                <div class="title">
                    <span id="formTitle">教工分类设置</span> <a title="关闭" onclick="ClosePopForm('popTable', true);">
                        关闭</a>
                </div>
                <table id="PTableInfo" style="width: 95%; margin-top: 12px;" border="0" class="layoutTable">
                        <tr>
                            <td style="height:50px;text-align:right">分类：
                            </td>
                            <td colspan="2" style="text-align:left">
                                <asp:DropDownList ID="ddl_SetFType" runat="server">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td style="text-align:left">
                                <input id="btn_SetFType" onclick="ChangeFType()" type="button" value="设置" class="commonBut" />
                            </td>
                            <td style="text-align:left">
                                <input id="btn_Exit" type="button" value="取消" onclick="javascript:ClosePopForm('popTable', true)" class="commonBut" />
                            </td>
                        </tr>
                 </table>
            </div>
                
            </div>
        </div>
    </form>
</body>
</html>
